package com.marvels.product.param.api.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.marvels.common.exception.MarvelsBusinessException;
import com.marvels.product.param.api.ProductConsultFeeApi;
import com.marvels.product.param.dto.McptConsultingFeeDTO;
import com.marvels.product.param.dto.McptManagementFeeDTO;
import com.marvels.product.param.dto.McptProduct;
import com.marvels.product.param.dto.McptRateDTO;
import com.marvels.product.param.dto.McptRiskFeeDTO;
import com.marvels.product.param.service.ConsultingFeeService;
import com.marvels.product.param.service.McptRateService;
import com.marvels.product.param.service.MngFeeService;
import com.marvels.product.param.service.ProductItemService;
import com.marvels.product.param.service.RiskFeeService;
import com.marvels.product.productmanage.dto.McptProductFundRelationDto;
import com.marvels.product.productmanage.dto.McptProductTypeDto;
import com.marvels.product.productmanage.service.ProductTypeService;

@Service
public class ProductConsultFeeImpl implements ProductConsultFeeApi{

	@Autowired
	private ProductTypeService productTypeService;
	
	@Autowired
	private  RiskFeeService  riskFeeService;
	
	@Autowired
	private MngFeeService mngFeeService;
	
	@Autowired
	private ConsultingFeeService consultingFeeService;
	
	@Autowired
	private McptRateService mcptRateService;
	
	@Autowired
	private ProductItemService productItemService;
	
	@Override
	public McptConsultingFeeDTO selectByProductCode(String productCode) {
		return null;//代码报错mcptConsultingFeeMapper.selectByProductCode(productCode);
	}

	@Override
	public McptRiskFeeDTO getEntityByPrimaryKey(Long riskFeeId) throws MarvelsBusinessException {
		return riskFeeService.getEntityByPrimaryKey(riskFeeId);
	}

	@Override
	public McptProductTypeDto getProductType(Long id) throws MarvelsBusinessException {
		return productTypeService.getProduct(id);
	}
	
	@Override
	public McptManagementFeeDTO getMngfee(Long managementFeeId) throws MarvelsBusinessException {
		return mngFeeService.getEntityByPrimaryKey(managementFeeId);
	}

	@Override
	public McptConsultingFeeDTO getConsultingFee(Long consultingFeeId) throws MarvelsBusinessException {
		return consultingFeeService.getEntityByPrimaryKey(consultingFeeId);
	}

	@Override
	public McptRateDTO getInterestRate(Long rateId) throws MarvelsBusinessException {
		return mcptRateService.selectByPrimaryKey(rateId);
	}

	@Override
	public List<McptProductFundRelationDto> getProductFundingSource(McptProductFundRelationDto mcpdto) throws MarvelsBusinessException {
		List<McptProductFundRelationDto> prdto = productTypeService.queryProductMappingFund(mcpdto);
		return prdto;
	}

	@Override
	public McptProduct getProduct(McptProduct dto) throws MarvelsBusinessException {
		// TODO Auto-generated method stub
		return productItemService.getByProductCode(dto);
	}
	
	
}
